#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isBalanced(string num) {
        int even = 0, sig = 0;
        for (int i = 0; i < num.size(); i++)
        {
            if (i % 2)
                sig += num[i] - '0';
            else
                even += num[i] - '0';
        }
        return even == sig;
    }
};